CC=gcc
FILE=affichage_gtk.c callbacks.c
OBJ=affichage_gtk.o callbacks.o
NAME=ivy_test
FLAG=-ansi -Wall -pedantic -g `pkg-config --libs --cflags gtk+-2.0`
PCRELIB = `pcre-config --libs`
EXTRALIB= -Llibivy
EXTRAINC=-Ilibivy

#.IGNORE:
#.SILENT:

all:	clean	ivy

	
ivy: $(OBJ) libivy/libivy.a
	$(CC)  $(FLAG) -Ilibivy -o ivy_test $(OBJ) $(PCRELIB) $(EXTRALIB) -lglibivy

util:	$(OBJ)
	$(CC) $(OBJ) $(FLAG) -o $(NAME)

%.o: %.c
	$(CC) $(FLAG) -c $< -o $@
	
afichage_gtk.o: affichage_gtk.c
	$(CC) -c $< $(FLAG) $(EXTRAINC)
	
callbacks.o: callbacks.c
	$(CC) -c $< $(FLAG) $(EXTRAINC)
	
test:	callbacks.o affichage_gtk.o
	$(CC) -o test callbacks.o affichage_gtk.o $(FLAG) $(EXTRALIB) $(PCRELIB) -lglibivy

clean:
	rm -f *.o
	
run:
	./$(NAME)